'use strict';

/**
 * 课表相关接口
 */
const scheduleCtrl = require('../../controllers/schedule');
const router = require('koa-router')();
const multer = require('koa-multer');
// 内存缓存
const upload = multer({
    storage: multer.memoryStorage(),
    limits: {
        fieldSize: 5 * 1024 * 1024
    }
});

router.post("/import_schedule", upload.single('file'), scheduleCtrl.import_schedule);
router.post("/upload", upload.single('file'), scheduleCtrl.import_schedule);

router.post('/delete_schedule', scheduleCtrl.delete_schedule);
router.post('/query', scheduleCtrl.query);
router.post('/bind_classroom', scheduleCtrl.bind_classroom);

module.exports = router;
